import { Dictionary } from "@/types/common/dictionary";
import { model, Schema, Types } from "mongoose";

const DictionarySchema = new Schema<Dictionary>(
    {
        title: { type: String, required: true },
        key: { type: String, required: true, unique: true },
        status: { type: Boolean, default: true },
        remark: String,
        dictItems: {
            type: [Types.ObjectId],
            default: [],
        },
    },
    { timestamps: { createdAt: true, updatedAt: true } }
);

export const DictionaryModel = model("Dictionary", DictionarySchema);
